//
//  PrivatePhotosCollectionViewCell.m
//  UniversalApp
//
//  Created by 志刚杨 on 2018/2/28.
//  Copyright © 2018年 voidcat. All rights reserved.
//

#import "PrivatePhotosCollectionViewCell.h"

@implementation PrivatePhotosCollectionViewCell
{
//    UIImageView *imagevc;
    UILabel     *status;//审核状态
}
- (void)awakeFromNib {
    [super awakeFromNib];
    [self createUI];
}
-(void)createUI
{
    _imagevc = [[UIImageView alloc] init];
    _imagevc.image = [[CYCommon new] getEpmayImage];
    _imagevc.contentMode = UIViewContentModeScaleAspectFill;
    status = [[UILabel alloc] init];
    status.textColor = [UIColor whiteColor];
    status.text = ASLocalizedString(@"审核中");
    status.font = DEFAULT_FONT(18);
    
    [self addSubview:_imagevc];
    [self addSubview:status];
    
    [self setLayout];
}

-(void)setLayout
{
    [_imagevc mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self);
    }];
    
    [status mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self);
    }];
}
-(void)setModel:(PrivatePhotosModel *)model
{
    _model = model;
//    'status':'0审核中1成功2拒绝'，
    if(model.status == 0)
    {
        status.hidden = NO;
    }
    else
    {
        status.hidden = YES;
    }
    [_imagevc sd_setImageWithURL:[cyurl safeUrl:model.img]];
}
@end
